import Vue from 'vue'
import App from './App.vue'
import './css/style.scss'
import {createRouter} from './router'
import {createStore} from './store'
import { sync } from 'vuex-router-sync'
// 导出一个工厂函数，用于创建新的
export function createApp () {
  const router = createRouter();
  const store = createStore();
  sync(store, router)
  const app = new Vue({
    router,
    store,
    render: h => h(App)
  })
  return { app, router, store }
}